package com.aaa.controller;

import com.aaa.entity.Activity;
import com.aaa.service.impl.ActivityServiceimpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("acivity")
@RestController
public class ActivityController {

    @Resource
    ActivityServiceimpl acivityServiceimpl;

    @RequestMapping("add")
    public Integer add(Activity activity){
        return acivityServiceimpl.Addactivity(activity);
    }

    @RequestMapping("find")
    public List<Activity> find(){
        return acivityServiceimpl.find();
    }
    @RequestMapping("update")
    public Integer update(Activity newactivity){
        System.out.println(newactivity.getStart());
        System.out.println(newactivity.getEnd());
        return acivityServiceimpl.updactivity(newactivity);
    }


}
